package com.caiyi.financial.nirvana.sms.service;

import com.caiyi.financial.nirvana.sms.base.service.BaseService;
import com.caiyi.financial.nirvana.sms.entity.SmsUserRecharge;
import com.caiyi.financial.nirvana.sms.mapper.CustomerRechargeMapper;
import com.caiyi.financial.nirvana.sms.querybean.PageBean;
import com.caiyi.financial.nirvana.sms.querybean.UserRechargeQueryBean;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerRechargeService extends BaseService<SmsUserRecharge> {

    @Autowired
    private CustomerRechargeMapper customerRechargeMapper;

    public PageBean<SmsUserRecharge> getUserRechargeListByParams(UserRechargeQueryBean bean) {
        PageHelper.startPage(bean.getPageNum(), bean.getPageSize());
        List<SmsUserRecharge> list = customerRechargeMapper.selectUserRechargeListByParams(bean);
        PageBean<SmsUserRecharge> pageBean = new PageBean<>(list);
        return pageBean;
    }
}
